using UnityEngine;
using System.Collections;

public class WowadiusCommonBehaviour : MonoBehaviour
{
	private float _destroyTimer = 0f;
	private const float SECOND_TILL_DESTROY = 3f;
	// Update is called once per frame
	void FixedUpdate ()
	{
		if (!renderer.isVisible) {
			//Destroy timer, in case the object just "wanders" out of the screen
			_destroyTimer += Time.deltaTime;
		}
	
		//Destroy when is out of scope
		if (_destroyTimer >= SECOND_TILL_DESTROY)
			Destroy (gameObject);
	}
}
